import Vue from 'vue'
import Router from 'vue-router'

import NotFound from '../../containers/home/404.vue';
import Container from '../../containers/index.vue';
import Login from '../../containers/home/login.vue';

Vue.use(Router);

export default new Router({
    routes: [
        {
            path: '/login',
            name: '登录',
            component: Login
        },
        {
            path: '*',
            component: NotFound
        },
        {
            path: '/',
            component: Container,
            redirect: '/login',
            children: [
                {
                    path: 'home',
                    component: () => import( /* webpackChunkName: "home-home" */ '../../containers/home/home.vue')
                },
            ]
        },
        {
            path: '/goods',
            component: Container,
            children: [
                {
                    path: 'list',
                    component: () => import( /* webpackChunkName: "goods-list" */ '../../containers/goods/list.vue')
                },
                {
                    path: 'detail',
                    component: () => import( /* webpackChunkName: "goods-detail" */ '../../containers/goods/detail.vue')
                },
                {
                    path: 'specification',
                    component: () => import( /* webpackChunkName: "goods-specification" */ '../../containers/goods/specification.vue')
                },
                {
                    path: 'category',
                    component: () => import( /* webpackChunkName: "goods-category" */ '../../containers/goods/category.vue')
                },
            ]
        },
        {
            path: '/basic',
            component: Container,
            children: [
                {
                    path: 'company-info',
                    component: () => import( /* webpackChunkName: "b-info" */ '../../containers/basic-data/company-info.vue')
                },
                {
                    path: 'basic-data',
                    component: () => import( /* webpackChunkName: "b-data" */ '../../containers/basic-data/basic-data.vue')
                },
                {
                    path: 'company-address',
                    component: () => import( /* webpackChunkName: "b-address" */ '../../containers/basic-data/company-address.vue')
                },
                {
                    path: 'courier',
                    component: () => import( /* webpackChunkName: "b-courier" */ '../../containers/basic-data/courier.vue')
                },
                {
                    path: 'banner',
                    component: () => import( /* webpackChunkName: "b-banner" */ '../../containers/basic-data/banner.vue')
                },
                {
                    path: 'single-list',
                    component: () => import( /* webpackChunkName: "b-list" */ '../../containers/basic-data/single-list.vue')
                },
                {
                    path: 'single-detail',
                    component: () => import( /* webpackChunkName: "b-detail" */ '../../containers/basic-data/single-detail.vue')
                },
            ]
        },
        {
            path: '/promotion',
            component: Container,
            children: [
                {
                    path: 'list',
                    component: () => import( /* webpackChunkName: "promotion-list" */ '../../containers/promotion/list.vue')
                },
                {
                    path: 'detail',
                    component: () => import( /* webpackChunkName: "promotion-detail" */ '../../containers/promotion/detail.vue')
                },
                {
                    path: 'add',
                    component: () => import( /* webpackChunkName: "promotion-add" */ '../../containers/promotion/add.vue')
                },
            ]
        },
        {
            path: '/order',
            component: Container,
            children: [
                {
                    path: 'list',
                    component: () => import( /* webpackChunkName: "order-list" */ '../../containers/order/list.vue')
                },
                {
                    path: 'detail',
                    component: () => import( /* webpackChunkName: "order-detail" */ '../../containers/order/detail.vue')
                },
            ]
        },
        {
            path: '/user',
            component: Container,
            children: [
                {
                    path: 'list',
                    component: () => import( /* webpackChunkName: "user-list" */ '../../containers/user/list.vue')
                },
                {
                    path: 'cert',
                    component: () => import( /* webpackChunkName: "user-cert" */ '../../containers/user/cert.vue')
                },
                {
                    path: 'company-cert',
                    component: () => import( /* webpackChunkName: "user-company-cert" */ '../../containers/user/company-cert.vue')
                },
                {
                    path: 'change',
                    component: () => import( /* webpackChunkName: "user-change" */ '../../containers/user/change.vue')
                },
                {
                    path: 'apply',
                    component: () => import( /* webpackChunkName: "user-apply" */ '../../containers/user/apply.vue')
                },
            ]
        },
        {
            path: '/resource',
            component: Container,
            children: [
                {
                    path: 'images',
                    component: () => import( /* webpackChunkName: "resource-images" */ '../../containers/resource/images.vue')
                },
            ]
        },
        {
            path: '/my',
            component: Container,
            children: [
                {
                    path: 'password',
                    component: () => import( /* webpackChunkName: "my-password" */ '../../containers/my/password.vue')
                },
                {
                    path: 'userinfo',
                    component: () => import( /* webpackChunkName: "my-userinfo" */ '../../containers/my/userinfo.vue')
                },
            ]
        },
        {
            path: '/system',
            component: Container,
            name: '系统管理',
            children: [
                {
                    path: 'manage-list',
                    component: () => import( /* webpackChunkName: "system-manage-list" */ '../../containers/system/manage-list.vue')
                },
                {
                    path: 'manage-page',
                    component: () => import( /* webpackChunkName: "system-manage-page" */ '../../containers/system/manage-page.vue')
                },
                {
                    path: 'auth',
                    component: () => import( /* webpackChunkName: "system-auth" */ '../../containers/system/auth.vue')
                },
                {
                    path: 'manage-role',
                    component: () => import( /* webpackChunkName: "system-manage-role" */ '../../containers/system/manage-role.vue')
                },
                {
                    path: 'manage-role-detail',
                    component: () => import( /* webpackChunkName: "system-role-add" */ '../../containers/system/manage-role-detail.vue')
                },
                {
                    path: 'log',
                    component: () => import( /* webpackChunkName: "system-log" */ '../../containers/system/log.vue')
                },
                {
                    path: 'develop-log',
                    component: () => import( /* webpackChunkName: "system-develop-log" */ '../../containers/system/develop-log.vue')
                },
            ]
        },

    ]
})